## --------------------------------------------------------------------
## ykit FAMysql
## --------------------------------------------------------------------


    set(SOURCES_files_SourceFiles
      FAMysql.cpp
	  FAMysql.h
	  MSConnect.cpp
	  MSConnect.h	  
	  FAMysql.def
	  ../inc/FAMysql/ArchiveVector.h
	  ../inc/ctpImpl/marketDataArchive.h
    )
    source_group("Source Files" FILES ${SOURCES_files_SourceFiles})

    set(SOURCES_SourceFiles
      ${SOURCES_files_SourceFiles}
    )
	
	set(SOURCES_
		${SOURCES_SourceFiles}
	)

INCLUDE_DIRECTORIES(../inc/)
INCLUDE_DIRECTORIES(../inc/mysql/win)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)

  if(WIN32)	
   SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
   SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2")
   SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2")
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od")
endif(WIN32)

SET(ProjectName FAMysql)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

ADD_LIBRARY(${ProjectName} SHARED ${SOURCES_})
Add_Definitions(-DFAMYSQL_EXPORTS)
Add_Definitions(-DUNICODE -D_UNICODE)

ADD_DEPENDENCIES(${ProjectName} FABase FACore FAJson)
TARGET_LINK_LIBRARIES(${ProjectName} ws2_32 FABase FACore libmysql FAJson)

if(NOT WIN32)
add_definitions(-D_PORT_VERSION -Wno-deprecated  -fPIC)
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Release" OR "MinSizeRel" OR "RelWithDebInfo")
add_definitions(-DNDEBUG)
endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Release" OR "MinSizeRel" OR "RelWithDebInfo")
endif(NOT WIN32)
